
<!DOCTYPE HTML>
<html lang="cn" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>项目初始化 · 前端学习笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="chengdaohua">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="guifan.html" />
    
    
    <link rel="prev" href="huakucha.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://chengdaohua.gitee.io/remarkbook/" target="_blank" class="custom-link">Home</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="./">
            
                <a href="./">
            
                    
                    vue 学习
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="start.html">
            
                <a href="start.html">
            
                    
                    原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="mokuaihua.html">
            
                <a href="mokuaihua.html">
            
                    
                    模块化和组件化开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="huakucha.html">
            
                <a href="huakucha.html">
            
                    
                    花裤衩项目
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.4" data-path="chushihua.html">
            
                <a href="chushihua.html">
            
                    
                    项目初始化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="guifan.html">
            
                <a href="guifan.html">
            
                    
                    代码规范
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../js/jsReadme.html">
            
                <a href="../js/jsReadme.html">
            
                    
                    javaScript
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../js/array.html">
            
                <a href="../js/array.html">
            
                    
                    数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../js/object.html">
            
                <a href="../js/object.html">
            
                    
                    对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../js/function.html">
            
                <a href="../js/function.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../js/string.html">
            
                <a href="../js/string.html">
            
                    
                    字符串
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../review/project.html">
            
                <a href="../review/project.html">
            
                    
                    review
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../review/CodeReview.html">
            
                <a href="../review/CodeReview.html">
            
                    
                    CoderReview
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../node/简介.html">
            
                <a href="../node/简介.html">
            
                    
                    node
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../node/简介.html">
            
                <a href="../node/简介.html">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../node/express.html">
            
                <a href="../node/express.html">
            
                    
                    express
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../ts/ts.html">
            
                <a href="../ts/ts.html">
            
                    
                    ts
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../websocket/websocket.html">
            
                <a href="../websocket/websocket.html">
            
                    
                    websocket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../webpack/webpack.html">
            
                <a href="../webpack/webpack.html">
            
                    
                    webpack
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >项目初始化</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="&#x9879;&#x76EE;&#x521D;&#x59CB;&#x5316;&#x914D;&#x7F6E;"><a name="&#x9879;&#x76EE;&#x521D;&#x59CB;&#x5316;&#x914D;&#x7F6E;" class="plugin-anchor" href="#&#x9879;&#x76EE;&#x521D;&#x59CB;&#x5316;&#x914D;&#x7F6E;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x9879;&#x76EE;&#x521D;&#x59CB;&#x5316;&#x914D;&#x7F6E;</h3>
<h5 id="1&#x3001;vscode-&#x4E2D;&#x914D;&#x7F6E;-eslint-&#x548C;-prettier"><a name="1&#x3001;vscode-&#x4E2D;&#x914D;&#x7F6E;-eslint-&#x548C;-prettier" class="plugin-anchor" href="#1&#x3001;vscode-&#x4E2D;&#x914D;&#x7F6E;-eslint-&#x548C;-prettier"><i class="fa fa-link" aria-hidden="true"></i></a>1&#x3001;vscode &#x4E2D;&#x914D;&#x7F6E; eslint &#x548C; prettier</h5>
<ul>
<li>eslint &#x7528;&#x4E8E;&#x6821;&#x9A8C;&#x4E66;&#x5199;&#x89C4;&#x8303;&#xFF0C;&#x5305;&#x62EC;&#x4EE3;&#x7801;&#x89C4;&#x8303;&#xFF0C;prettier &#x4E3B;&#x8981;&#x7528;&#x4E8E;&#x6821;&#x9A8C;&#x683C;&#x5F0F;&#xFF0C;&#x5E76;&#x81EA;&#x52A8;&#x5316;&#x3002;</li>
<li>&#x5B89;&#x88C5;&#x8FC7;&#x7A0B;&#xFF1A;&#x9879;&#x76EE;&#x4E2D; npm i &#x5B89;&#x88C5; eslint&#xFF0C;vscode &#x5B89;&#x88C5;&#x63D2;&#x4EF6; prettier&#xFF0C;&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;&#x6DFB;&#x52A0;.prettierrc &#x6587;&#x4EF6;&#xFF0C;&#x914D;&#x7F6E; vscode &#x4E2D;&#x7684; setting&#xFF0C;&#x91CD;&#x542F;&#x5373;&#x53EF;&#x3002;</li>
</ul>
<pre><code>// &#x5B89;&#x88C5;eslint
npm install eslint &#x6216;&#x8005; yarn add eslint
</code></pre><pre><code>
```
&#x6DFB;&#x52A0;.eslintrc.js&#x6587;&#x4EF6;&#xFF0C;&#x914D;&#x7F6E;&#x9879; &lt;br/&gt;
[zhixiu-admin&#x4E2D;eslint&#x914D;&#x7F6E;](https://gitee.com/chengdaohua/zhixiu-admin/blob/master/.eslintrc.js)
&#x6DFB;&#x52A0;.eslintignore.js&#x6587;&#x4EF6;&#xFF0C;&#x5FFD;&#x7565;&#x6587;&#x4EF6;&#x914D;&#x7F6E;&#x9879; &lt;br/&gt;
https://gitee.com/chengdaohua/zhixiu-admin/blob/master/.eslintignore
// &#x6DFB;&#x52A0;.prettierrc&#x6587;&#x4EF6;&#xFF0C;&#x7F6E;&#x5165;
{
   //&#x5F00;&#x542F; eslint &#x652F;&#x6301;
  &quot;eslintIntegration&quot;: true,
  //&#x4F7F;&#x7528;&#x5355;&#x5F15;&#x53F7;
  &quot;singleQuote&quot;: true,
  //&#x7ED3;&#x5C3E;&#x4E0D;&#x52A0;&#x5206;&#x53F7;
  &quot;semi&quot;: false
}
</code></pre><pre><code>// vscode&#x4E2D;&#x8BBE;&#x7F6E;seeting
&#x89C6;&#x56FE;&#x5DE6;&#x4E0B;&#x89D2;&#x6253;&#x5F00;&#xFF0C;setting&#x6253;&#x5F00;&#xFF0C;&#x53F3;&#x4E0A;&#x89D2;open&#x6587;&#x4EF6;&#xFF0C;&#x7F6E;&#x5165;

{
  // vscode&#x9ED8;&#x8BA4;&#x542F;&#x7528;&#x4E86;&#x6839;&#x636E;&#x6587;&#x4EF6;&#x7C7B;&#x578B;&#x81EA;&#x52A8;&#x8BBE;&#x7F6E;tabsize&#x7684;&#x9009;&#x9879;
  &quot;editor.detectIndentation&quot;: false,
  // &#x91CD;&#x65B0;&#x8BBE;&#x5B9A;tabsize
  &quot;editor.tabSize&quot;: 2,
  // #&#x6BCF;&#x6B21;&#x4FDD;&#x5B58;&#x7684;&#x65F6;&#x5019;&#x81EA;&#x52A8;&#x683C;&#x5F0F;&#x5316;
  &quot;editor.formatOnSave&quot;: true,
  //  #&#x53BB;&#x6389;&#x4EE3;&#x7801;&#x7ED3;&#x5C3E;&#x7684;&#x5206;&#x53F7;
  &quot;prettier.semi&quot;: true,
  //  #&#x4F7F;&#x7528;&#x5E26;&#x5F15;&#x53F7;&#x66FF;&#x4EE3;&#x53CC;&#x5F15;&#x53F7;
  &quot;prettier.singleQuote&quot;: true,
  //  #&#x8BA9;&#x51FD;&#x6570;(&#x540D;)&#x548C;&#x540E;&#x9762;&#x7684;&#x62EC;&#x53F7;&#x4E4B;&#x95F4;&#x52A0;&#x4E2A;&#x7A7A;&#x683C;
  &quot;javascript.format.insertSpaceBeforeFunctionParenthesis&quot;: false,
  &quot;javascript.updateImportsOnFileMove.enabled&quot;: &quot;always&quot;,
  &quot;[properties]&quot;: {},
  &quot;jest.debugMode&quot;: true,
  &quot;editor.maxTokenizationLineLength&quot;: 50000,
  &quot;gitlens.advanced.messages&quot;: {
    &quot;suppressLineUncommittedWarning&quot;: true,
    &quot;suppressSupportGitLensNotification&quot;: true
  },
  &quot;javascript.implicitProjectConfig.experimentalDecorators&quot;: true,
  &quot;editor.snippetSuggestions&quot;: &quot;top&quot;,
  &quot;[html]&quot;: {
    &quot;editor.defaultFormatter&quot;: &quot;vscode.html-language-features&quot;
  },
  &quot;gitlens.gitCommands.closeOnFocusOut&quot;: true,
  &quot;editor.codeActionsOnSave&quot;: {
    &quot;source.fixAll.eslint&quot;: true
  },
  &quot;files.associations&quot;: {
    &quot;*.cjson&quot;: &quot;jsonc&quot;,
    &quot;*.wxss&quot;: &quot;css&quot;,
    &quot;*.wxs&quot;: &quot;javascript&quot;
  },
  &quot;emmet.includeLanguages&quot;: {
    &quot;wxml&quot;: &quot;html&quot;
  },
  // &#x683C;&#x5F0F;&#x5316;stylus, &#x9700;&#x5B89;&#x88C5;Manta&apos;s Stylus Supremacy&#x63D2;&#x4EF6;
  &quot;stylusSupremacy.insertColons&quot;: true, // &#x662F;&#x5426;&#x63D2;&#x5165;&#x5192;&#x53F7;
  &quot;stylusSupremacy.insertSemicolons&quot;: false, // &#x662F;&#x5426;&#x63D2;&#x5165;&#x5206;&#x597D;
  &quot;stylusSupremacy.insertBraces&quot;: false, // &#x662F;&#x5426;&#x63D2;&#x5165;&#x5927;&#x62EC;&#x53F7;
  &quot;stylusSupremacy.insertNewLineAroundImports&quot;: false, // import&#x4E4B;&#x540E;&#x662F;&#x5426;&#x6362;&#x884C;
  &quot;stylusSupremacy.insertNewLineAroundBlocks&quot;: false,
  &quot;minapp-vscode.disableAutoConfig&quot;: true // &#x4E24;&#x4E2A;&#x9009;&#x62E9;&#x5668;&#x4E2D;&#x662F;&#x5426;&#x6362;&#x884C;
}
</code></pre><h5 id="2&#x3001;css-&#x6837;&#x5F0F;&#x4F7F;&#x7528;-stylus"><a name="2&#x3001;css-&#x6837;&#x5F0F;&#x4F7F;&#x7528;-stylus" class="plugin-anchor" href="#2&#x3001;css-&#x6837;&#x5F0F;&#x4F7F;&#x7528;-stylus"><i class="fa fa-link" aria-hidden="true"></i></a>2&#x3001;CSS &#x6837;&#x5F0F;&#x4F7F;&#x7528; stylus</h5>
<ul>
<li>stylus &#x76F8;&#x6BD4; sass &#x548C; less&#xFF0C;&#x4E66;&#x5199;&#x65B9;&#x5F0F;&#x66F4;&#x52A0;&#x7B80;&#x4FBF;&#xFF0C;&#x5927;&#x62EC;&#x53F7;&#x548C;&#x7ED3;&#x5C3E;&#x5206;&#x53F7;&#xFF0C;&#x90FD;&#x53EF;&#x4EE5;&#x7701;&#x7565;</li>
<li>&#x5B89;&#x88C5;&#x914D;&#x7F6E;&#xFF1A; npm &#x5B89;&#x88C5; stylus&#xFF0C;stylus-loader,&#x9875;&#x9762;&#x4E2D;&#x76F4;&#x63A5;&#x5F15;&#x5165;(&#x4F4E;&#x7248;&#x672C;&#x9700;&#x8981;&#x81EA;&#x5DF1;&#x914D;&#x7F6E; webpack &#x76F8;&#x5173; loader)</li>
</ul>
<pre><code>// npm&#x5B89;&#x88C5;
npm install stylus&#xFF0C;stylus-loader
</code></pre><pre><code>// vue&#x9875;&#x9762;&#x5F15;&#x5165;
&lt;style scoped lang=&quot;stylus&quot; rel=&quot;stylesheet/stylus&quot;&gt;
  .dashboard
    &amp;-container
      margin: 30px
    &amp;-text
      font-size: 30px
      line-height: 46px
&lt;/style&gt;
</code></pre><h5 id="3&#x3001;typescripte"><a name="3&#x3001;typescripte" class="plugin-anchor" href="#3&#x3001;typescripte"><i class="fa fa-link" aria-hidden="true"></i></a>3&#x3001;typescripte</h5>
<p>&#x5F85;&#x6DFB;&#x52A0;</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; wml 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-12-31 13:24:52
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="huakucha.html" class="navigation navigation-prev " aria-label="Previous page: 花裤衩项目">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="guifan.html" class="navigation navigation-next " aria-label="Next page: 代码规范">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"项目初始化","level":"1.2.4","depth":2,"next":{"title":"代码规范","level":"1.2.5","depth":2,"path":"category/vue/guifan.md","ref":"category/vue/guifan.md","articles":[]},"previous":{"title":"花裤衩项目","level":"1.2.3","depth":2,"path":"category/vue/huakucha.md","ref":"category/vue/huakucha.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","anchors","sitemap-general","toggle-chapters","expandable-chapters","splitter","edit-link","advanced-emoji","tbfed-pagefooter"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy wml 2019","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"github":{"url":"https://gitee.com/chengdaohua/remarkBook"},"simple-page-toc":{"maxDepth":3,"skipFirstH1":false},"splitter":{},"search-pro":{"cutWordLib":"nodejieba","defineWord":["gitbook-use"]},"search":{},"donate":{"wechat":"","alipay":"","title":"","button":"赏","alipayText":"支付宝打赏","wechatText":"微信打赏"},"sitemap-general":{"prefix":"https://chengdaohua.gitee.io/remarkbook/"},"changyan":{"appid":"cytowLiqM","conf":"the conf in the code generate by changyan"},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"sitemap":{"hostname":"https://wmlhub.gitee.io/gitbook/"},"baidu":{"token":"084b900a1e26f6bae60e09d18e3aa455"},"advanced-emoji":{"embedEmojis":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":true,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"Edit This Page","base":"https://gitee.com/chengdaohua/remarkBook"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{},"expandable-chapters":{}},"theme":"default","author":"chengdaohua","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"前端学习笔记","language":"cn","links":{"sidebar":{"Home":"https://chengdaohua.gitee.io/remarkbook/"}},"gitbook":"3.2.3","description":"记录日常学习总结"},"file":{"path":"category/vue/chushihua.md","mtime":"2019-12-31T05:24:52.704Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-05-22T06:18:21.707Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

